import  pandas
from  sqlalchemy import  create_engine
# order=pandas.read_table(r'D:\计算机\bin\3103014787\FileRecv\数据分析素材\第4章\任务程序\data/meal_order_info.csv',sep=',',encoding='gbk')
# order['use_start_time']=pandas.to_datetime(order['use_start_time'])
# order['lock_time']=pandas.to_datetime(order['lock_time'])
# print('进行转换后订单信息表use_start_time和lock_time的类型为:\n',order[['use_start_time','lock_time']].dtypes)

# year = [i.year for i in order ['lock_time']]
# month=[ i.month for i in order['lock_time']]
# day = [ i.day for i in order ['lock_time']]
# week = [i.week for i in order['lock_time']]
# weekday=[i.weekday() for i in order['lock_time']]
# #提取星期名称日期
# weekname=[i.day_name for i in order['lock_time']]
# print('订单详情表中的前5条数据的年份信息为:',year[:5])
# print('星期名称信息为:',weekname[:5])


# timemin=order['lock_time'].min()
# timemax=order['lock_time'].max()
# print('订单最早的时间:',timemin)
# print('订单持续时间:',timemax-timemin)
#
# ChekTime=order['lock_time'] -order['use_start_time']
# print(ChekTime.mean())
# print(ChekTime.min())
# print(ChekTime.max())
engine=create_engine('mysql+pymysql://root:1234@127.0.0.1:\3306/')